//
// Copyright © 2025 Agora
// This file is part of TEN Framework, an open source project.
// Licensed under the Apache License, Version 2.0, with certain conditions.
// Refer to the "LICENSE" file in the root directory for more information.
//
#ifndef __COEFF_H__
#define __COEFF_H__

#include "aed_st.h"

#define AUP_AED_MEAN_STD_NBINS AUP_AED_FEA_LEN

#define AUP_AED_ASSUMED_HOPSZ (256)
#define AUP_AED_ASSUMED_WINDOWSZ (768)
#define AUP_AED_ASSUMED_FFTSZ (1024)

// means of inpu-mel-filterbank
const float AUP_AED_FEATURE_MEANS[AUP_AED_MEAN_STD_NBINS] = {
    -8.198236465454e+00f, -6.265716552734e+00f, -5.483818531036e+00f,
    -4.758691310883e+00f, -4.417088985443e+00f, -4.142892837524e+00f,
    -3.912850379944e+00f, -3.845927953720e+00f, -3.657090425491e+00f,
    -3.723418712616e+00f, -3.876134157181e+00f, -3.843890905380e+00f,
    -3.690405130386e+00f, -3.756065845490e+00f, -3.698696136475e+00f,
    -3.650463104248e+00f, -3.700468778610e+00f, -3.567321300507e+00f,
    -3.498900175095e+00f, -3.477807044983e+00f, -3.458816051483e+00f,
    -3.444923877716e+00f, -3.401328563690e+00f, -3.306261301041e+00f,
    -3.278556823730e+00f, -3.233250856400e+00f, -3.198616027832e+00f,
    -3.204526424408e+00f, -3.208798646927e+00f, -3.257838010788e+00f,
    -3.381376743317e+00f, -3.534021377563e+00f, -3.640867948532e+00f,
    -3.726858854294e+00f, -3.773730993271e+00f, -3.804667234421e+00f,
    -3.832901000977e+00f, -3.871120452881e+00f, -3.990592956543e+00f,
    -4.480289459229e+00f, 9.235690307617e+01f};

// stds of input-mel-filterbank
const float AUP_AED_FEATURE_STDS[AUP_AED_MEAN_STD_NBINS] = {
    5.166063785553e+00f, 4.977209568024e+00f, 4.698895931244e+00f,
    4.630621433258e+00f, 4.634347915649e+00f, 4.641156196594e+00f,
    4.640676498413e+00f, 4.666367053986e+00f, 4.650534629822e+00f,
    4.640020847321e+00f, 4.637400150299e+00f, 4.620099067688e+00f,
    4.596316337585e+00f, 4.562654972076e+00f, 4.554360389709e+00f,
    4.566910743713e+00f, 4.562489986420e+00f, 4.562412738800e+00f,
    4.585299491882e+00f, 4.600179672241e+00f, 4.592845916748e+00f,
    4.585922718048e+00f, 4.583496570587e+00f, 4.626092910767e+00f,
    4.626957893372e+00f, 4.626289367676e+00f, 4.637005805969e+00f,
    4.683015823364e+00f, 4.726813793182e+00f, 4.734289646149e+00f,
    4.753227233887e+00f, 4.849722862244e+00f, 4.869434833527e+00f,
    4.884482860565e+00f, 4.921327114105e+00f, 4.959212303162e+00f,
    4.996619224548e+00f, 5.044823646545e+00f, 5.072216987610e+00f,
    5.096439361572e+00f, 1.152136917114e+02f};

const float AUP_AED_STFTWindow_Hann768[768] = {
    0.0000000e+00f, 1.6733041e-05f, 6.6931045e-05f, 1.5059065e-04f,
    2.6770626e-04f, 4.1827004e-04f, 6.0227190e-04f, 8.1969953e-04f,
    1.0705384e-03f, 1.3547717e-03f, 1.6723803e-03f, 2.0233432e-03f,
    2.4076367e-03f, 2.8252351e-03f, 3.2761105e-03f, 3.7602327e-03f,
    4.2775693e-03f, 4.8280857e-03f, 5.4117450e-03f, 6.0285082e-03f,
    6.6783340e-03f, 7.3611788e-03f, 8.0769970e-03f, 8.8257407e-03f,
    9.6073598e-03f, 1.0421802e-02f, 1.1269013e-02f, 1.2148935e-02f,
    1.3061510e-02f, 1.4006678e-02f, 1.4984373e-02f, 1.5994532e-02f,
    1.7037087e-02f, 1.8111967e-02f, 1.9219101e-02f, 2.0358415e-02f,
    2.1529832e-02f, 2.2733274e-02f, 2.3968661e-02f, 2.5235910e-02f,
    2.6534935e-02f, 2.7865651e-02f, 2.9227967e-02f, 3.0621794e-02f,
    3.2047037e-02f, 3.3503601e-02f, 3.4991388e-02f, 3.6510300e-02f,
    3.8060234e-02f, 3.9641086e-02f, 4.1252752e-02f, 4.2895122e-02f,
    4.4568088e-02f, 4.6271536e-02f, 4.8005353e-02f, 4.9769424e-02f,
    5.1563629e-02f, 5.3387849e-02f, 5.5241962e-02f, 5.7125844e-02f,
    5.9039368e-02f, 6.0982406e-02f, 6.2954829e-02f, 6.4956504e-02f,
    6.6987298e-02f, 6.9047074e-02f, 7.1135695e-02f, 7.3253021e-02f,
    7.5398909e-02f, 7.7573217e-02f, 7.9775799e-02f, 8.2006508e-02f,
    8.4265194e-02f, 8.6551706e-02f, 8.8865891e-02f, 9.1207593e-02f,
    9.3576658e-02f, 9.5972925e-02f, 9.8396234e-02f, 1.0084642e-01f,
    1.0332333e-01f, 1.0582679e-01f, 1.0835663e-01f, 1.1091268e-01f,
    1.1349477e-01f, 1.1610274e-01f, 1.1873640e-01f, 1.2139558e-01f,
    1.2408010e-01f, 1.2678978e-01f, 1.2952444e-01f, 1.3228389e-01f,
    1.3506796e-01f, 1.3787646e-01f, 1.4070919e-01f, 1.4356597e-01f,
    1.4644661e-01f, 1.4935091e-01f, 1.5227868e-01f, 1.5522973e-01f,
    1.5820385e-01f, 1.6120085e-01f, 1.6422052e-01f, 1.6726267e-01f,
    1.7032709e-01f, 1.7341358e-01f, 1.7652192e-01f, 1.7965192e-01f,
    1.8280336e-01f, 1.8597603e-01f, 1.8916971e-01f, 1.9238420e-01f,
    1.9561929e-01f, 1.9887474e-01f, 2.0215035e-01f, 2.0544589e-01f,
    2.0876115e-01f, 2.1209590e-01f, 2.1544993e-01f, 2.1882300e-01f,
    2.2221488e-01f, 2.2562536e-01f, 2.2905421e-01f, 2.3250119e-01f,
    2.3596607e-01f, 2.3944863e-01f, 2.4294863e-01f, 2.4646583e-01f,
    2.5000000e-01f, 2.5355090e-01f, 2.5711830e-01f, 2.6070196e-01f,
    2.6430163e-01f, 2.6791708e-01f, 2.7154806e-01f, 2.7519434e-01f,
    2.7885565e-01f, 2.8253178e-01f, 2.8622245e-01f, 2.8992744e-01f,
    2.9364649e-01f, 2.9737934e-01f, 3.0112576e-01f, 3.0488549e-01f,
    3.0865828e-01f, 3.1244388e-01f, 3.1624203e-01f, 3.2005248e-01f,
    3.2387498e-01f, 3.2770926e-01f, 3.3155507e-01f, 3.3541216e-01f,
    3.3928027e-01f, 3.4315913e-01f, 3.4704849e-01f, 3.5094809e-01f,
    3.5485766e-01f, 3.5877695e-01f, 3.6270569e-01f, 3.6664362e-01f,
    3.7059048e-01f, 3.7454600e-01f, 3.7850991e-01f, 3.8248196e-01f,
    3.8646187e-01f, 3.9044938e-01f, 3.9444422e-01f, 3.9844613e-01f,
    4.0245484e-01f, 4.0647007e-01f, 4.1049157e-01f, 4.1451906e-01f,
    4.1855226e-01f, 4.2259092e-01f, 4.2663476e-01f, 4.3068351e-01f,
    4.3473690e-01f, 4.3879466e-01f, 4.4285652e-01f, 4.4692220e-01f,
    4.5099143e-01f, 4.5506394e-01f, 4.5913946e-01f, 4.6321772e-01f,
    4.6729844e-01f, 4.7138134e-01f, 4.7546616e-01f, 4.7955263e-01f,
    4.8364046e-01f, 4.8772939e-01f, 4.9181913e-01f, 4.9590943e-01f,
    5.0000000e-01f, 5.0409057e-01f, 5.0818087e-01f, 5.1227061e-01f,
    5.1635954e-01f, 5.2044737e-01f, 5.2453384e-01f, 5.2861866e-01f,
    5.3270156e-01f, 5.3678228e-01f, 5.4086054e-01f, 5.4493606e-01f,
    5.4900857e-01f, 5.5307780e-01f, 5.5714348e-01f, 5.6120534e-01f,
    5.6526310e-01f, 5.6931649e-01f, 5.7336524e-01f, 5.7740908e-01f,
    5.8144774e-01f, 5.8548094e-01f, 5.8950843e-01f, 5.9352993e-01f,
    5.9754516e-01f, 6.0155387e-01f, 6.0555578e-01f, 6.0955062e-01f,
    6.1353813e-01f, 6.1751804e-01f, 6.2149009e-01f, 6.2545400e-01f,
    6.2940952e-01f, 6.3335638e-01f, 6.3729431e-01f, 6.4122305e-01f,
    6.4514234e-01f, 6.4905191e-01f, 6.5295151e-01f, 6.5684087e-01f,
    6.6071973e-01f, 6.6458784e-01f, 6.6844493e-01f, 6.7229074e-01f,
    6.7612502e-01f, 6.7994752e-01f, 6.8375797e-01f, 6.8755612e-01f,
    6.9134172e-01f, 6.9511451e-01f, 6.9887424e-01f, 7.0262066e-01f,
    7.0635351e-01f, 7.1007256e-01f, 7.1377755e-01f, 7.1746822e-01f,
    7.2114435e-01f, 7.2480566e-01f, 7.2845194e-01f, 7.3208292e-01f,
    7.3569837e-01f, 7.3929804e-01f, 7.4288170e-01f, 7.4644910e-01f,
    7.5000000e-01f, 7.5353417e-01f, 7.5705137e-01f, 7.6055137e-01f,
    7.6403393e-01f, 7.6749881e-01f, 7.7094579e-01f, 7.7437464e-01f,
    7.7778512e-01f, 7.8117700e-01f, 7.8455007e-01f, 7.8790410e-01f,
    7.9123885e-01f, 7.9455411e-01f, 7.9784965e-01f, 8.0112526e-01f,
    8.0438071e-01f, 8.0761580e-01f, 8.1083029e-01f, 8.1402397e-01f,
    8.1719664e-01f, 8.2034808e-01f, 8.2347808e-01f, 8.2658642e-01f,
    8.2967291e-01f, 8.3273733e-01f, 8.3577948e-01f, 8.3879915e-01f,
    8.4179615e-01f, 8.4477027e-01f, 8.4772132e-01f, 8.5064909e-01f,
    8.5355339e-01f, 8.5643403e-01f, 8.5929081e-01f, 8.6212354e-01f,
    8.6493204e-01f, 8.6771611e-01f, 8.7047556e-01f, 8.7321022e-01f,
    8.7591990e-01f, 8.7860442e-01f, 8.8126360e-01f, 8.8389726e-01f,
    8.8650523e-01f, 8.8908732e-01f, 8.9164337e-01f, 8.9417321e-01f,
    8.9667667e-01f, 8.9915358e-01f, 9.0160377e-01f, 9.0402708e-01f,
    9.0642334e-01f, 9.0879241e-01f, 9.1113411e-01f, 9.1344829e-01f,
    9.1573481e-01f, 9.1799349e-01f, 9.2022420e-01f, 9.2242678e-01f,
    9.2460109e-01f, 9.2674698e-01f, 9.2886431e-01f, 9.3095293e-01f,
    9.3301270e-01f, 9.3504350e-01f, 9.3704517e-01f, 9.3901759e-01f,
    9.4096063e-01f, 9.4287416e-01f, 9.4475804e-01f, 9.4661215e-01f,
    9.4843637e-01f, 9.5023058e-01f, 9.5199465e-01f, 9.5372846e-01f,
    9.5543191e-01f, 9.5710488e-01f, 9.5874725e-01f, 9.6035891e-01f,
    9.6193977e-01f, 9.6348970e-01f, 9.6500861e-01f, 9.6649640e-01f,
    9.6795296e-01f, 9.6937821e-01f, 9.7077203e-01f, 9.7213435e-01f,
    9.7346506e-01f, 9.7476409e-01f, 9.7603134e-01f, 9.7726673e-01f,
    9.7847017e-01f, 9.7964159e-01f, 9.8078090e-01f, 9.8188803e-01f,
    9.8296291e-01f, 9.8400547e-01f, 9.8501563e-01f, 9.8599332e-01f,
    9.8693849e-01f, 9.8785107e-01f, 9.8873099e-01f, 9.8957820e-01f,
    9.9039264e-01f, 9.9117426e-01f, 9.9192300e-01f, 9.9263882e-01f,
    9.9332167e-01f, 9.9397149e-01f, 9.9458825e-01f, 9.9517191e-01f,
    9.9572243e-01f, 9.9623977e-01f, 9.9672389e-01f, 9.9717476e-01f,
    9.9759236e-01f, 9.9797666e-01f, 9.9832762e-01f, 9.9864523e-01f,
    9.9892946e-01f, 9.9918030e-01f, 9.9939773e-01f, 9.9958173e-01f,
    9.9973229e-01f, 9.9984941e-01f, 9.9993307e-01f, 9.9998327e-01f,
    1.0000000e+00f, 9.9998327e-01f, 9.9993307e-01f, 9.9984941e-01f,
    9.9973229e-01f, 9.9958173e-01f, 9.9939773e-01f, 9.9918030e-01f,
    9.9892946e-01f, 9.9864523e-01f, 9.9832762e-01f, 9.9797666e-01f,
    9.9759236e-01f, 9.9717476e-01f, 9.9672389e-01f, 9.9623977e-01f,
    9.9572243e-01f, 9.9517191e-01f, 9.9458825e-01f, 9.9397149e-01f,
    9.9332167e-01f, 9.9263882e-01f, 9.9192300e-01f, 9.9117426e-01f,
    9.9039264e-01f, 9.8957820e-01f, 9.8873099e-01f, 9.8785107e-01f,
    9.8693849e-01f, 9.8599332e-01f, 9.8501563e-01f, 9.8400547e-01f,
    9.8296291e-01f, 9.8188803e-01f, 9.8078090e-01f, 9.7964159e-01f,
    9.7847017e-01f, 9.7726673e-01f, 9.7603134e-01f, 9.7476409e-01f,
    9.7346506e-01f, 9.7213435e-01f, 9.7077203e-01f, 9.6937821e-01f,
    9.6795296e-01f, 9.6649640e-01f, 9.6500861e-01f, 9.6348970e-01f,
    9.6193977e-01f, 9.6035891e-01f, 9.5874725e-01f, 9.5710488e-01f,
    9.5543191e-01f, 9.5372846e-01f, 9.5199465e-01f, 9.5023058e-01f,
    9.4843637e-01f, 9.4661215e-01f, 9.4475804e-01f, 9.4287416e-01f,
    9.4096063e-01f, 9.3901759e-01f, 9.3704517e-01f, 9.3504350e-01f,
    9.3301270e-01f, 9.3095293e-01f, 9.2886431e-01f, 9.2674698e-01f,
    9.2460109e-01f, 9.2242678e-01f, 9.2022420e-01f, 9.1799349e-01f,
    9.1573481e-01f, 9.1344829e-01f, 9.1113411e-01f, 9.0879241e-01f,
    9.0642334e-01f, 9.0402708e-01f, 9.0160377e-01f, 8.9915358e-01f,
    8.9667667e-01f, 8.9417321e-01f, 8.9164337e-01f, 8.8908732e-01f,
    8.8650523e-01f, 8.8389726e-01f, 8.8126360e-01f, 8.7860442e-01f,
    8.7591990e-01f, 8.7321022e-01f, 8.7047556e-01f, 8.6771611e-01f,
    8.6493204e-01f, 8.6212354e-01f, 8.5929081e-01f, 8.5643403e-01f,
    8.5355339e-01f, 8.5064909e-01f, 8.4772132e-01f, 8.4477027e-01f,
    8.4179615e-01f, 8.3879915e-01f, 8.3577948e-01f, 8.3273733e-01f,
    8.2967291e-01f, 8.2658642e-01f, 8.2347808e-01f, 8.2034808e-01f,
    8.1719664e-01f, 8.1402397e-01f, 8.1083029e-01f, 8.0761580e-01f,
    8.0438071e-01f, 8.0112526e-01f, 7.9784965e-01f, 7.9455411e-01f,
    7.9123885e-01f, 7.8790410e-01f, 7.8455007e-01f, 7.8117700e-01f,
    7.7778512e-01f, 7.7437464e-01f, 7.7094579e-01f, 7.6749881e-01f,
    7.6403393e-01f, 7.6055137e-01f, 7.5705137e-01f, 7.5353417e-01f,
    7.5000000e-01f, 7.4644910e-01f, 7.4288170e-01f, 7.3929804e-01f,
    7.3569837e-01f, 7.3208292e-01f, 7.2845194e-01f, 7.2480566e-01f,
    7.2114435e-01f, 7.1746822e-01f, 7.1377755e-01f, 7.1007256e-01f,
    7.0635351e-01f, 7.0262066e-01f, 6.9887424e-01f, 6.9511451e-01f,
    6.9134172e-01f, 6.8755612e-01f, 6.8375797e-01f, 6.7994752e-01f,
    6.7612502e-01f, 6.7229074e-01f, 6.6844493e-01f, 6.6458784e-01f,
    6.6071973e-01f, 6.5684087e-01f, 6.5295151e-01f, 6.4905191e-01f,
    6.4514234e-01f, 6.4122305e-01f, 6.3729431e-01f, 6.3335638e-01f,
    6.2940952e-01f, 6.2545400e-01f, 6.2149009e-01f, 6.1751804e-01f,
    6.1353813e-01f, 6.0955062e-01f, 6.0555578e-01f, 6.0155387e-01f,
    5.9754516e-01f, 5.9352993e-01f, 5.8950843e-01f, 5.8548094e-01f,
    5.8144774e-01f, 5.7740908e-01f, 5.7336524e-01f, 5.6931649e-01f,
    5.6526310e-01f, 5.6120534e-01f, 5.5714348e-01f, 5.5307780e-01f,
    5.4900857e-01f, 5.4493606e-01f, 5.4086054e-01f, 5.3678228e-01f,
    5.3270156e-01f, 5.2861866e-01f, 5.2453384e-01f, 5.2044737e-01f,
    5.1635954e-01f, 5.1227061e-01f, 5.0818087e-01f, 5.0409057e-01f,
    5.0000000e-01f, 4.9590943e-01f, 4.9181913e-01f, 4.8772939e-01f,
    4.8364046e-01f, 4.7955263e-01f, 4.7546616e-01f, 4.7138134e-01f,
    4.6729844e-01f, 4.6321772e-01f, 4.5913946e-01f, 4.5506394e-01f,
    4.5099143e-01f, 4.4692220e-01f, 4.4285652e-01f, 4.3879466e-01f,
    4.3473690e-01f, 4.3068351e-01f, 4.2663476e-01f, 4.2259092e-01f,
    4.1855226e-01f, 4.1451906e-01f, 4.1049157e-01f, 4.0647007e-01f,
    4.0245484e-01f, 3.9844613e-01f, 3.9444422e-01f, 3.9044938e-01f,
    3.8646187e-01f, 3.8248196e-01f, 3.7850991e-01f, 3.7454600e-01f,
    3.7059048e-01f, 3.6664362e-01f, 3.6270569e-01f, 3.5877695e-01f,
    3.5485766e-01f, 3.5094809e-01f, 3.4704849e-01f, 3.4315913e-01f,
    3.3928027e-01f, 3.3541216e-01f, 3.3155507e-01f, 3.2770926e-01f,
    3.2387498e-01f, 3.2005248e-01f, 3.1624203e-01f, 3.1244388e-01f,
    3.0865828e-01f, 3.0488549e-01f, 3.0112576e-01f, 2.9737934e-01f,
    2.9364649e-01f, 2.8992744e-01f, 2.8622245e-01f, 2.8253178e-01f,
    2.7885565e-01f, 2.7519434e-01f, 2.7154806e-01f, 2.6791708e-01f,
    2.6430163e-01f, 2.6070196e-01f, 2.5711830e-01f, 2.5355090e-01f,
    2.5000000e-01f, 2.4646583e-01f, 2.4294863e-01f, 2.3944863e-01f,
    2.3596607e-01f, 2.3250119e-01f, 2.2905421e-01f, 2.2562536e-01f,
    2.2221488e-01f, 2.1882300e-01f, 2.1544993e-01f, 2.1209590e-01f,
    2.0876115e-01f, 2.0544589e-01f, 2.0215035e-01f, 1.9887474e-01f,
    1.9561929e-01f, 1.9238420e-01f, 1.8916971e-01f, 1.8597603e-01f,
    1.8280336e-01f, 1.7965192e-01f, 1.7652192e-01f, 1.7341358e-01f,
    1.7032709e-01f, 1.6726267e-01f, 1.6422052e-01f, 1.6120085e-01f,
    1.5820385e-01f, 1.5522973e-01f, 1.5227868e-01f, 1.4935091e-01f,
    1.4644661e-01f, 1.4356597e-01f, 1.4070919e-01f, 1.3787646e-01f,
    1.3506796e-01f, 1.3228389e-01f, 1.2952444e-01f, 1.2678978e-01f,
    1.2408010e-01f, 1.2139558e-01f, 1.1873640e-01f, 1.1610274e-01f,
    1.1349477e-01f, 1.1091268e-01f, 1.0835663e-01f, 1.0582679e-01f,
    1.0332333e-01f, 1.0084642e-01f, 9.8396234e-02f, 9.5972925e-02f,
    9.3576658e-02f, 9.1207593e-02f, 8.8865891e-02f, 8.6551706e-02f,
    8.4265194e-02f, 8.2006508e-02f, 7.9775799e-02f, 7.7573217e-02f,
    7.5398909e-02f, 7.3253021e-02f, 7.1135695e-02f, 6.9047074e-02f,
    6.6987298e-02f, 6.4956504e-02f, 6.2954829e-02f, 6.0982406e-02f,
    5.9039368e-02f, 5.7125844e-02f, 5.5241962e-02f, 5.3387849e-02f,
    5.1563629e-02f, 4.9769424e-02f, 4.8005353e-02f, 4.6271536e-02f,
    4.4568088e-02f, 4.2895122e-02f, 4.1252752e-02f, 3.9641086e-02f,
    3.8060234e-02f, 3.6510300e-02f, 3.4991388e-02f, 3.3503601e-02f,
    3.2047037e-02f, 3.0621794e-02f, 2.9227967e-02f, 2.7865651e-02f,
    2.6534935e-02f, 2.5235910e-02f, 2.3968661e-02f, 2.2733274e-02f,
    2.1529832e-02f, 2.0358415e-02f, 1.9219101e-02f, 1.8111967e-02f,
    1.7037087e-02f, 1.5994532e-02f, 1.4984373e-02f, 1.4006678e-02f,
    1.3061510e-02f, 1.2148935e-02f, 1.1269013e-02f, 1.0421802e-02f,
    9.6073598e-03f, 8.8257407e-03f, 8.0769970e-03f, 7.3611788e-03f,
    6.6783340e-03f, 6.0285082e-03f, 5.4117450e-03f, 4.8280857e-03f,
    4.2775693e-03f, 3.7602327e-03f, 3.2761105e-03f, 2.8252351e-03f,
    2.4076367e-03f, 2.0233432e-03f, 1.6723803e-03f, 1.3547717e-03f,
    1.0705384e-03f, 8.1969953e-04f, 6.0227190e-04f, 4.1827004e-04f,
    2.6770626e-04f, 1.5059065e-04f, 6.6931045e-05f, 1.6733041e-05f};

#endif
